<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { formatDate } from '@n2/shared-utils'

const currentTime = ref('')

const updateTime = () => {
  currentTime.value = formatDate(new Date(), 'YYYY-MM-DD')
}

onMounted(() => {
  updateTime()
  // 每秒更新一次时间
  setInterval(updateTime, 1000)
})
</script>

<template>
  <div class="home">
    <h1>欢迎来到 N2 系统</h1>
    <p>当前日期：{{ currentTime }}</p>
  </div>
</template>

<style scoped>
.home {
  padding: 20px;
  text-align: center;
}
</style>